package com.feng.ssm;

import com.feng.ssm.pojo.Book;
import com.feng.ssm.service.BookServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SqlSessionFactory {
    @Test
    public void test(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationConfig.xml");
        BookServiceImpl bookService = context.getBean(BookServiceImpl.class);
        int i = bookService.addBook(new Book(1, "斗罗大陆II", 2, "今天是2021年11月3日，现在是09:19"));
        System.out.println("添加了："+i+" 类书");
    }
}
